<?php

/**
 * Template part for displaying posts
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
 *
 * @package Wordkit
 */

?>

<article id="post-<?php the_ID(); ?>" class="uk-article">
	<header>

		<div class="uk-margin-large-bottom">
			<?php wordkit_post_thumbnail(); ?>
		</div>

		<?php

		if ('post' === get_post_type()) :
		?>
			<div class="uk-article-meta">
				<time><?php echo esc_html(get_the_date()); ?></time>
			</div><!-- .uk-article-meta -->
		<?php

		endif;

		if (is_singular()) :
			the_title('<h1 class="uk-article-title uk-margin">', '</h1>');
		else :
			the_title('<h2 class="uk-article-title uk-link-muted uk-link-reset uk-margin"><a href="' . esc_url(get_permalink()) . '" rel="bookmark">', '</a></h2>');
		endif;

		?>
	</header>

	<div class="uk-clearfix">
		<?php
		the_content();
		if (is_singular()) :
		?>
			<div class="uk-float-left">
				<?php
				wp_link_pages(array(
					'before' => '<ul class="uk-pagination uk-link-reset">',
					'after'  => '</ul>',
					'link_before'  => '<li>',
					'link_after'  => '</li>',
				));
				?>
			</div>
		<?php
		endif;
		?>
		<div class="uk-float-right uk-button uk-button-text uk-link-reset">
			<?php
			edit_post_link();
			?>
		</div>
	</div><!-- .uk-clearfix -->
</article><!-- #post-<?php the_ID(); ?> -->